package zlatan_demo13_match

object ClassDemo05 {
  def main(args: Array[String]): Unit = {
    val arr1 = Array(1, 2, 3)
    val arr2 = Array(0)
    val arr3 = Array(0, 1, 23)

    arr1 match {  //匹配arr1
      case Array(1, x, y) => println(s"匹配到arr1,剩下两个元素为${x},${y}")
      case Array(0) => println("匹配到arr2")
      case Array(0, _*) => println("匹配到arr3")
    }

  }

}
